package cn.wolfcode.shop.cloud.service;


import cn.wolfcode.shop.cloud.vo.SeckillGoodVO;

import java.util.List;


public interface ISeckillGoodService {

    List<SeckillGoodVO> query();

    SeckillGoodVO queryById(Long seckillId);

    /**
     * 减少库存
     * @param seckillId
     * @return
     */
    int decrCount(Long seckillId);

    SeckillGoodVO queryByIdCache(Long seckillId);

    /**
     * 在redis中查询所有VO数据
     * @return
     */
    List<SeckillGoodVO> queryCache();

    /**
     * 加真实库存
     * @param seckillId
     */
    void incrCount(Long seckillId);

    /**
     * 回补预库存
     * @param goodId
     */
    void syncRedisCount(Long goodId);
}
